import Vue from 'vue'
import VueRouter from 'vue-router'

// 路由懒加载
const HelloWorld = () => import('@/components/HelloWorld')
const WX = () => import('@/view/wx/Wx')
const AddressBook = () => import('@/view/addressBook/AddressBook')
const Find = () => import('@/view/find/Find')
const Me = () => import('@/view/me/Me')


Vue.use(VueRouter)
const routes = [
  // {
  //     path: '/',
  //     name: 'HelloWorld',
  //     component: HelloWorld
  // }
  {
    path: '',
    redirect: '/wx'
  },
  {
    path: '/wx',
    component: WX
  },
  {
    path: '/helloWorld',
    component: HelloWorld
  },
  {
    path: '/addressBook',
    component: AddressBook
  },
  {
    path: '/wx',
    component: WX
  },
  {
    path: '/find',
    component: Find
  },
  {
    path: '/me',
    component: Me
  }
]
const router = new VueRouter({
  routes,
  // url模式
  mode:'history'
})

export default router
